<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::$app->name;?> 后台管理</title>
<?php $this->HeaderView();?>
</head>
<body class="view_index" id="view_index_Category">
<input type="submit" value="添加字段" class="btn-button-g" onclick="href('<?php echo $this->createUrl(['mobo/models/create-field', 'modelid'=>$modelid]);?>')">
<form class="view-index-form" method="post" action="<?php echo $this->createUrl(['mobo/models/field-batch', 'modelid'=>$modelid]);?>" enctype="multipart/form-data">
<input type="hidden" value="<?php echo $modelid?>" name="modelid" />
<table class="view-index-list" border="0" cellspacing="0" cellpadding="0" width="100%">
    <thead>
        <tr>
          <th width="50">排序</th>
                        <th>字段名称</th>
                        <th width="100">别名</th>
                        <th width="100">控件类型</th>
                        <th width="100">字段类型</th>
                        <th width="60">主表字段</th>
                        <th width="60">允许录入</th>
                        <th width="40">必填</th>
            <th class="edit norightborder">操作</th>
        </tr>
    </thead>
    <tbody>
        <?php
	use \backend\modules\mobo\models\Models;
    foreach($models as $k=>$v){
    ?>
    <tr>
              <td><input class="input-text input-listorder" value="<?php echo $v['listorder'];?>" name="listorder[<?php echo $v['fieldid'];?>]"/></td>
        
        <td><?php echo $v['field'];?></td>
                
        <td><?php echo $v['name'];?></td>
        <td><?php echo Models::formtype($v['formtype']);?></td>
        <td><?php echo $v['fieldtype'].($v['fieldlength'] ? '('.$v['fieldlength'].')' : '');?></td>
        <td><?php echo $v['primarytable'] ? '是' : '否';?></td>
        <td><?php echo $v['allowinput'] ? '是' : '否';?></td>
        <td><?php echo $v['required'] ? '是' : '否';?></td>
        
                <td class="td-operation">
            <a href="<?php echo $this->createUrl(['mobo/models/update-field','modelid'=>$v['modelid'], 'fieldid'=>$v['fieldid']])?>" title="编辑" class="operation-update">编辑</a> <a href="<?php echo $this->createUrl(['mobo/models/delete','modelid'=>$v['modelid'], 'fieldid'=>$v['fieldid']])?>" title="删除" class="operation-delete">删除</a></td>
        <?php
}
?>    </tr>
<tr style="background-color:#eee" class="batch">
<td colspan="100">
<div class="pages ftr right">
<?=$this->linkPager($pages)?>
</div>
<input type="button" class="button-submit ml-5" value="全选" name="chkall" id="chkall" onclick="checkAll(this, 'checked_id[]');"><input type="button" class="button-submit button-reverse" value="反选" name="chkall" id="chkall" onclick="checkReverse(this, 'checked_id[]');">

<input id="batch_delete" class="button-submit ml-5" type="submit" value="批量删除" name="batch_delete" onclick="return confirm_delete('checked_id[]', this);">

<input id="submit_search" class="button-submit ml-5" type="submit" value="排序" name="batch_listorder">

</td>
</tr> 
        </tbody>
    
</table>

<?=$this->csrfToken()?>
</form>
<?php $this->FooterView();?>
</body>
</html>